home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!sun-barr!ames!pasteur!nntp
- From: scott.oaks@East.Sun.COM (Scott Oaks)
- Newsgroups: comp.sources.x
- Subject: v15i160: OpenLook Virtual Window Mgr (3.0), Part14/21
- Message-ID: <1992Feb4.135858.7875@pasteur.Berkeley.EDU>
- Date: 4 Feb 92 13:58:58 GMT
- References: <csx-15i147-olvwm-3.0@uunet.UU.NET>
- Sender: dcmartin@msi.com (David C. Martin - Moderator)
- Organization: University of California, at Berkeley
- Lines: 1911
- Approved: dcmartin@msi.com
- Nntp-Posting-Host: postgres.berkeley.edu
-
- Submitted-by: scott.oaks@East.Sun.COM (Scott Oaks)
- Posting-number: Volume 15, Issue 160
- Archive-name: olvwm-3.0/part14
-
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # If this archive is complete, you will see the following message at the end:
- # "End of archive 14 (of 21)."
- # Contents: Notice.c ol_button.c vdm.icon
- # Wrapped by dcmartin@fascet on Tue Jan 14 05:54:46 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Notice.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Notice.c'\"
- else
- echo shar: Extracting \"'Notice.c'\" \(22967 characters\)
- sed "s/^X//" >'Notice.c' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1989, 1990 Sun Microsystems, Inc. Sun design patents
- X * pending in the U.S. and foreign countries. See LEGAL_NOTICE
- X * file for terms of the license.
- X */
- X
- X#ident "@(#)Notice.c 1.1 olvwm version 1/3/92"
- X
- X/*
- X * Based on
- X#ident "@(#)Notice.c 26.19 91/09/14 SMI"
- X *
- X */
- X
- X#include <errno.h>
- X#include <stdio.h>
- X#include <ctype.h>
- X#include <X11/Xos.h>
- X#include <X11/Xlib.h>
- X#include <X11/Xutil.h>
- X#include <olgx/olgx.h>
- X
- X#include "i18n.h"
- X#include "ollocale.h"
- X#include "olwm.h"
- X#include "win.h"
- X#include "notice.h"
- X#include "globals.h"
- X#include "mem.h"
- X#include "events.h"
- X
- X
- Xextern int PointInRect();
- Xextern SemanticAction FindKeyboardAction();
- X
- X#define NOTICE_EVENT_MASK ( ButtonPressMask | ButtonReleaseMask \
- X | PointerMotionMask | KeyPressMask \
- X | ExposureMask )
- X#define NOTICE_ATTR_MASK ( CWBorderPixel | CWColormap | \
- X CWEventMask | CWSaveUnder )
- X
- X/* difference between inside beveled box and outside beveled box */
- X#define BORDER_WIDTH 5
- X#define MIN_BOX_SIDE ( 15 + BORDER_WIDTH ) /* betw side & text */
- X#define MIN_BOX_TOP ( 15 + BORDER_WIDTH ) /* betw top & text */
- X#define MIN_BOX_BOTTOM ( 15 + BORDER_WIDTH ) /* betw bot & text */
- X#define MIN_BUTTON_SPACE 15 /* space between buttons */
- X#define MIN_BUTTON_VSPACE 15 /* space above buttons */
- X#define MIN_STRING_VSPACE 5 /* space above/below strings */
- X#define OUTLINE_WIDTH 2 /* thickness of 2D border */
- X
- Xtypedef struct {
- X int x;
- X int y;
- X unsigned int width; /* space taken up by text */
- X unsigned int fullWidth; /* width including endcaps */
- X char accelerator; /* mouseless accelerator key */
- X} noticeButtonDetails;
- X
- Xtypedef struct {
- X Display *dpy;
- X ScreenInfo *scrInfo;
- X NoticeBox *noticeBox;
- X int numStrings;
- X char **stringText;
- X Window window;
- X unsigned int buttonHeight;
- X unsigned int fontHeight;
- X unsigned int boxHeight;
- X unsigned int boxWidth;
- X int x;
- X int y;
- X int totalButtonWidth;
- X noticeButtonDetails *buttonInfo;
- X int buttonSelected;
- X int buttonFocus;
- X int buttonDown;
- X int buttonDrawnDown;
- X void (*noticeCallback)();
- X int pointerX,pointerY;
- X Bool ignoreExpose;
- X Bool warped;
- X} noticeBoxDetails;
- X
- Xstatic void calculateBoxDimensions();
- Xstatic void drawNoticeBox();
- Xstatic void noticeDone();
- Xstatic int noticeInterposer();
- X
- XnoticeBoxDetails *CreateNoticeBox();
- Xvoid DestroyNoticeBox();
- Xvoid ShowNoticeBox();
- X
- X
- X/******************************************************************
- X * Private Draw Functions
- X ******************************************************************/
- X
- X/*
- X * calculateBoxDimensions -- determine size of box needed, etc. based on
- X * information passed in in noticeBox structure. Return
- X * values in boxDetails structure.
- X */
- Xstatic void
- XcalculateBoxDimensions( noticeBox, boxDetails )
- XNoticeBox *noticeBox;
- XnoticeBoxDetails *boxDetails;
- X{
- X int screen = boxDetails->scrInfo->screen;
- X unsigned int displayWidth, displayHeight;
- X int longestStringLength = 0;
- X int totalButtonWidth = 0;
- X Graphics_info *gisButton = boxDetails->scrInfo->gi[BUTTON_GINFO];
- X int ii;
- X char *tok,*str;
- Xstatic char *sep = "\n";
- Xextern char *strtok();
- X
- X boxDetails->fontHeight = GRV.TextFontInfo->ascent +
- X GRV.TextFontInfo->descent;
- X
- X /* calculate the width of the text which appears inside the button */
- X for ( ii = 0 ; ii < noticeBox->numButtons ; ii++ ) {
- X boxDetails->buttonInfo[ii].width =
- X XTextWidth( GRV.ButtonFontInfo,
- X noticeBox->buttonText[ii],
- X strlen(noticeBox->buttonText[ii]) );
- X boxDetails->buttonInfo[ii].fullWidth =
- X boxDetails->buttonInfo[ii].width
- X + 2 * ButtonEndcap_Width(gisButton);
- X }
- X
- X /* make the key accelerators from the button text string */
- X for ( ii = 0 ; ii < noticeBox->numButtons ; ii++ ) {
- X boxDetails->buttonInfo[ii].accelerator =
- X tolower(*noticeBox->buttonText[ii]);
- X }
- X
- X /* add together widths of all the buttons */
- X for ( ii = 0 ; ii < noticeBox->numButtons ; ii++ )
- X totalButtonWidth += boxDetails->buttonInfo[ii].fullWidth;
- X boxDetails->totalButtonWidth = totalButtonWidth;
- X
- X /*
- X * Split the msg string into individual strings using newlines
- X */
- X
- X /* count the newlines in the msg starting with one */
- X for (ii = 1, str = noticeBox->msgText; *str != '\0'; str++) {
- X if (*str == '\n')
- X ii++;
- X }
- X
- X /* alloc the string pointer array */
- X boxDetails->numStrings = ii;
- X boxDetails->stringText =
- X (char **)MemAlloc(boxDetails->numStrings * sizeof(char *));
- X
- X /* split the msg string into separate string in stringText array */
- X str = MemNewString(noticeBox->msgText);
- X for (ii=0, tok=strtok(str,sep); tok; tok=strtok((char *)NULL,sep)) {
- X boxDetails->stringText[ii++] = MemNewString(tok);
- X }
- X MemFree(str);
- X
- X /* figure out which descriptive string is longest */
- X for ( ii = 0 ; ii < boxDetails->numStrings ; ii++ )
- X longestStringLength =
- X MAX( longestStringLength,
- X XTextWidth( GRV.TextFontInfo,
- X boxDetails->stringText[ii],
- X strlen(boxDetails->stringText[ii]) ) );
- X
- X /*
- X * REMIND: this calculation assumes all the buttons are
- X * on the same line
- X */
- X boxDetails->boxWidth = 2 * MIN_BOX_SIDE
- X + MAX( longestStringLength,
- X totalButtonWidth +
- X /* amount of space between all the buttons */
- X MIN_BUTTON_SPACE * (noticeBox->numButtons - 1) );
- X
- X boxDetails->buttonHeight = Button_Height(gisButton);
- X
- X boxDetails->boxHeight = MIN_BOX_TOP + MIN_BOX_BOTTOM
- X + ( boxDetails->numStrings * boxDetails->fontHeight )
- X /* amount of space vertically between all the strings */
- X + ( (boxDetails->numStrings - 1) * MIN_STRING_VSPACE )
- X + MIN_BUTTON_VSPACE + boxDetails->buttonHeight;
- X displayWidth = DisplayWidth( boxDetails->dpy, screen );
- X displayHeight = DisplayHeight( boxDetails->dpy, screen );
- X
- X /* if not set, create default "origin" for box: centered */
- X boxDetails->x = ( noticeBox->boxX == -1 )
- X ? (int)( displayWidth - boxDetails->boxWidth )/2
- X : noticeBox->boxX ;
- X boxDetails->y = ( noticeBox->boxY == -1 )
- X ? (int)( displayHeight - boxDetails->boxHeight )/2
- X : noticeBox->boxY ;
- X
- X}
- X
- X/*
- X * drawLocationCursor
- X */
- Xstatic void
- XdrawLocationCursor(details,btn,erase)
- X noticeBoxDetails *details;
- X int btn;
- X Bool erase;
- X{
- Xstatic XPoint pts[] = { 0,0, 6,11, -12,0 };
- X GC gc ;
- X
- X pts[0].x = details->buttonInfo[btn].x +
- X details->buttonInfo[btn].fullWidth/2;
- X pts[0].y = details->buttonInfo[btn].y +
- X details->buttonHeight - 7;
- X
- X if (erase)
- X gc = details->scrInfo->gc[WINDOW_GC];
- X else
- X gc = details->scrInfo->gc[FOREGROUND_GC];
- X
- X XFillPolygon(details->dpy,details->window,
- X gc,pts,3,Convex,CoordModePrevious);
- X}
- X
- X/*
- X * drawButton
- X */
- Xstatic void
- XdrawButton(noticeBox,details,btn,btnState)
- XNoticeBox *noticeBox;
- XnoticeBoxDetails *details;
- Xint btn;
- Xint btnState;
- X{
- X Graphics_info *gisButton = details->scrInfo->gi[BUTTON_GINFO];
- X int buttonState;
- X
- X if (noticeBox->defaultButton == btn) {
- X buttonState = btnState;
- X buttonState |= OLGX_DEFAULT;
- X } else {
- X buttonState = btnState;
- X }
- X
- X if (details->buttonFocus == btn)
- X drawLocationCursor(details,btn,(buttonState & OLGX_ERASE));
- X
- X olgx_draw_button(gisButton,details->window,
- X details->buttonInfo[btn].x,details->buttonInfo[btn].y,
- X details->buttonInfo[btn].fullWidth,0,
- X noticeBox->buttonText[btn],buttonState);
- X}
- X
- X/*
- X * drawNoticeBox -- draw box outline, strings, and buttons using information
- X * in noticeBox and boxDetails structures which are passed in.
- X * Location of buttons (x, y) are set in boxDetails structure
- X * for use later (mouse warping, determining pointer position).
- X */
- Xstatic void
- XdrawNoticeBox( noticeBox, boxDetails )
- XNoticeBox *noticeBox;
- XnoticeBoxDetails *boxDetails;
- X{
- X int ii;
- X int buttonX, buttonY;
- X int buttonState; /* OLGX_NORMAL or OLGX_DEFAULT */
- X Graphics_info *gisText = boxDetails->scrInfo->gi[TEXT_GINFO];
- X Graphics_info *gisButton = boxDetails->scrInfo->gi[BUTTON_GINFO];
- X
- X /* frame outline */
- X if (GRV.F3dFrames) {
- X
- X /* fill it in, because olgx doesn't fill in 2D */
- X if (!boxDetails->scrInfo->use3D)
- X XFillRectangle(boxDetails->dpy, boxDetails->window,
- X boxDetails->scrInfo->gc[WINDOW_GC], 0, 0,
- X boxDetails->boxWidth, boxDetails->boxHeight);
- X
- X olgx_draw_box(gisButton,
- X boxDetails->window, 0, 0,
- X boxDetails->boxWidth, boxDetails->boxHeight,
- X OLGX_NORMAL, True );
- X
- X } else {
- X GC gc = boxDetails->scrInfo->gc[BORDER_GC];
- X
- X XFillRectangle(boxDetails->dpy, boxDetails->window,
- X boxDetails->scrInfo->gc[WINDOW_GC], 0, 0,
- X boxDetails->boxWidth, boxDetails->boxHeight);
- X
- X XFillRectangle(boxDetails->dpy, boxDetails->window, gc,
- X 0, 0, boxDetails->boxWidth, OUTLINE_WIDTH);
- X XFillRectangle(boxDetails->dpy, boxDetails->window, gc,
- X 0, boxDetails->boxHeight - OUTLINE_WIDTH,
- X boxDetails->boxWidth, OUTLINE_WIDTH);
- X XFillRectangle(boxDetails->dpy, boxDetails->window, gc,
- X 0, OUTLINE_WIDTH, OUTLINE_WIDTH,
- X boxDetails->boxHeight - 2*OUTLINE_WIDTH);
- X XFillRectangle(boxDetails->dpy, boxDetails->window, gc,
- X boxDetails->boxWidth - OUTLINE_WIDTH, OUTLINE_WIDTH,
- X OUTLINE_WIDTH,
- X boxDetails->boxHeight - 2*OUTLINE_WIDTH);
- X }
- X
- X if (boxDetails->scrInfo->use3D) {
- X /* REMIND: this is a hack to draw a chiseled box */
- X olgx_draw_box(gisButton,
- X boxDetails->window, BORDER_WIDTH, BORDER_WIDTH,
- X boxDetails->boxWidth - 2 * BORDER_WIDTH,
- X boxDetails->boxHeight - 2 * BORDER_WIDTH,
- X OLGX_INVOKED, False);
- X olgx_draw_box(gisButton,
- X boxDetails->window, BORDER_WIDTH+1, BORDER_WIDTH+1,
- X boxDetails->boxWidth - 2 * BORDER_WIDTH - 2,
- X boxDetails->boxHeight - 2 * BORDER_WIDTH - 2,
- X OLGX_NORMAL, False);
- X } else {
- X olgx_draw_box(gisButton,
- X boxDetails->window, BORDER_WIDTH, BORDER_WIDTH,
- X boxDetails->boxWidth - 2 * BORDER_WIDTH,
- X boxDetails->boxHeight - 2 * BORDER_WIDTH,
- X OLGX_NORMAL, True);
- X }
- X
- X /* draw descriptive text
- X * REMIND: all strings are along the left edge (MIN_BOX_SIDE)
- X */
- X for ( ii = 0 ; ii < boxDetails->numStrings ; ii++ )
- X olgx_draw_text(gisText,
- X boxDetails->window, boxDetails->stringText[ii],
- X MIN_BOX_SIDE,
- X /* need to move each line further down the screen */
- X MIN_BOX_TOP + GRV.TextFontInfo->ascent * ( ii + 1 )
- X + ( MIN_STRING_VSPACE * ii ),
- X 0, False, OLGX_NORMAL );
- X
- X /* put buttons in - notice that it's a single row */
- X /* row of buttons should be centered within available space,
- X * assuming MIN_BUTTON_SPACE between each of the them
- X */
- X buttonX = ( boxDetails->boxWidth - (boxDetails->totalButtonWidth
- X + MIN_BUTTON_SPACE * (noticeBox->numButtons - 1)) )/2;
- X /* this calculates from the bottom of the box */
- X buttonY = ( boxDetails->boxHeight -
- X ( MIN_BOX_BOTTOM + boxDetails->buttonHeight ) );
- X for ( ii = 0 ; ii < noticeBox->numButtons ; ii++ )
- X {
- X if ( noticeBox->defaultButton == ii )
- X buttonState = OLGX_DEFAULT;
- X else
- X buttonState = OLGX_NORMAL;
- X
- X /* save button's x, y values for use later */
- X boxDetails->buttonInfo[ii].x = buttonX;
- X boxDetails->buttonInfo[ii].y = buttonY;
- X
- X olgx_draw_button(gisButton,
- X boxDetails->window, buttonX, buttonY,
- X boxDetails->buttonInfo[ii].fullWidth, 0,
- X noticeBox->buttonText[ii],
- X buttonState );
- X
- X /* set up buttonX for next button */
- X buttonX = buttonX + boxDetails->buttonInfo[ii].fullWidth
- X + MIN_BUTTON_SPACE;
- X }
- X
- X drawLocationCursor(boxDetails,boxDetails->buttonFocus,False);
- X}
- X
- X/******************************************************************
- X * Private Event Functions
- X ******************************************************************/
- X
- X
- X/*
- X * setButtonFocus - sets the focus button to the passed value and
- X * redraws the necessary buttons.
- X */
- Xstatic void
- XsetButtonFocus(details,newFocus)
- XnoticeBoxDetails *details;
- Xint newFocus;
- X{
- X int oldFocus = details->buttonFocus;
- X
- X drawButton(details->noticeBox,details,oldFocus,OLGX_ERASE);
- X details->buttonFocus = newFocus;
- X drawButton(details->noticeBox,details,newFocus,OLGX_NORMAL);
- X}
- X
- X/*
- X * moveButtonFocus - moves the focus button in the indicated direction
- X * and wraps around then first and last buttons.
- X */
- Xstatic void
- XmoveButtonFocus(details,dir)
- XnoticeBoxDetails *details;
- Xint dir;
- X{
- X NoticeBox *noticeBox = details->noticeBox;
- X int newFocus = details->buttonFocus;
- X
- X if (noticeBox->numButtons == 1)
- X return;
- X
- X newFocus += dir;
- X
- X if (newFocus >= noticeBox->numButtons)
- X newFocus = 0;
- X else if (newFocus < 0)
- X newFocus = noticeBox->numButtons-1;
- X
- X setButtonFocus(details,newFocus);
- X}
- X
- X/*
- X * keyAccelerator - if the key event matches one of the button accelerators
- X * return True and set button to the accelerated button.
- X */
- Xstatic Bool
- XkeyAccelerator(key,details,button)
- X XKeyEvent *key;
- X noticeBoxDetails *details;
- X int *button; /* RETURN */
- X{
- X NoticeBox *noticeBox = details->noticeBox;
- X char accel,str[10];
- X KeySym keySym;
- X int keyCount,i;
- X
- X keyCount = XLookupString(key,str,10,&keySym,NULL);
- X
- X if (keyCount != 1)
- X return False;
- X
- X accel = tolower(str[0]);
- X
- X for (i = 0; i < noticeBox->numButtons; i++) {
- X if (accel == details->buttonInfo[i].accelerator) {
- X *button = i;
- X return True;
- X }
- X }
- X
- X return False;
- X}
- X
- X/*
- X * pointInButton - True if the button is it the passed button number
- X */
- Xstatic Bool
- XpointInButton(event,details,btn)
- X XButtonEvent *event;
- X noticeBoxDetails *details;
- X int btn;
- X{
- X return PointInRect(event->x,event->y,
- X details->buttonInfo[btn].x,details->buttonInfo[btn].y,
- X details->buttonInfo[btn].fullWidth,details->buttonHeight);
- X}
- X
- X/*
- X * noticeInterposer - event handler for notices
- X */
- Xstatic int
- XnoticeInterposer(dpy,event,win,details)
- XDisplay *dpy;
- XXEvent *event;
- Xvoid *win;
- XnoticeBoxDetails *details;
- X{
- X NoticeBox *noticeBox = details->noticeBox;
- X int ii,button,buttonState;
- X
- X /*
- X * Discard synthetic events
- X */
- X if (event->xany.send_event)
- X return DISPOSE_USED;
- X
- X switch (event->type) {
- X case ButtonPress:
- X
- X /* first check to see if we're even in the notice box */
- X if (!PointInRect(event->xbutton.x,event->xbutton.y,
- X 0,0,details->boxWidth,details->boxHeight))
- X break;
- X
- X /* if on one of the notice buttons, depress it */
- X for ( ii = 0 ; ii < noticeBox->numButtons ; ii++ ) {
- X if (pointInButton(event,details,ii)) {
- X details->buttonDown = ii;
- X details->buttonDrawnDown = True;
- X drawButton(noticeBox,details,ii,OLGX_INVOKED);
- X break;
- X }
- X }
- X break;
- X
- X case ButtonRelease:
- X if (details->buttonDown < 0)
- X break;
- X
- X /* only a depressed button can be selected */
- X if (pointInButton(event,details,details->buttonDown)) {
- X details->buttonSelected = details->buttonDown;
- X noticeDone(dpy,details);
- X
- X /* else erase the depressed button and now unselected */
- X } else {
- X drawButton(noticeBox,details,
- X details->buttonDown,OLGX_ERASE);
- X details->buttonDown = -1;
- X details->buttonDrawnDown = False;
- X }
- X break;
- X
- X case MotionNotify:
- X if ( details->buttonDown < 0 )
- X break;
- X
- X /* if moved out of depressed button erase it and cancel */
- X if (!pointInButton(event,details,details->buttonDown)) {
- X drawButton(noticeBox,details,
- X details->buttonDown,OLGX_ERASE);
- X details->buttonDown = -1;
- X details->buttonDrawnDown = False;
- X }
- X break;
- X
- X case KeyPress:
- X switch (FindKeyboardAction(dpy,event)) {
- X case ACTION_EXEC_DEFAULT:
- X details->buttonSelected = noticeBox->defaultButton;
- X noticeDone(dpy,details);
- X break;
- X case ACTION_CANCEL:
- X case ACTION_STOP:
- X details->buttonSelected = NOTICE_CANCEL;
- X noticeDone(dpy,details);
- X break;
- X case ACTION_SELECT:
- X details->buttonSelected = details->buttonFocus;
- X noticeDone(dpy,details);
- X break;
- X case ACTION_NEXT_ELEMENT:
- X case ACTION_RIGHT:
- X moveButtonFocus(details,1);
- X break;
- X case ACTION_PREVIOUS_ELEMENT:
- X case ACTION_LEFT:
- X moveButtonFocus(details,-1);
- X break;
- X case ACTION_FIRST_CONTROL:
- X setButtonFocus(details,0);
- X break;
- X case ACTION_LAST_CONTROL:
- X setButtonFocus(details,noticeBox->numButtons-1);
- X break;
- X default:
- X if (keyAccelerator(event,details,&button))
- X setButtonFocus(details,button);
- X else
- X KeyBeep(dpy,event);
- X break;
- X }
- X case KeyRelease:
- X return DISPOSE_USED;
- X
- X case Expose:
- X /*
- X * Ignore the first expose, since we painted as soon as we
- X * mapped. Otherwise, we really were exposed, so repaint.
- X */
- X if (event->xexpose.count == 0) {
- X if (details->ignoreExpose)
- X details->ignoreExpose = False;
- X else
- X drawNoticeBox(details->noticeBox,details);
- X }
- X return DISPOSE_USED;
- X
- X default:
- X return DISPOSE_DEFER;
- X }
- X return DISPOSE_USED;
- X}
- X
- X
- X
- X/*
- X * noticeDone() -- warp pointer back, release grabs, remove interposer, call
- X * the callback, and clean up the notice window.
- X */
- Xstatic void
- XnoticeDone(dpy,boxDetails)
- XDisplay *dpy;
- XnoticeBoxDetails *boxDetails;
- X{
- X if (boxDetails->warped)
- X XWarpPointer(dpy,None,boxDetails->scrInfo->rootid,
- X 0,0,0,0,boxDetails->pointerX,boxDetails->pointerY);
- X
- X if (GRV.ServerGrabs)
- X XUngrabServer(dpy);
- X XUngrabKeyboard(dpy,CurrentTime);
- X XUngrabPointer(dpy,CurrentTime);
- X
- X UninstallInterposer();
- X
- X if (boxDetails->noticeCallback)
- X (*boxDetails->noticeCallback)(dpy,boxDetails->buttonSelected);
- X
- X DestroyNoticeBox(boxDetails);
- X}
- X
- X
- X/******************************************************************
- X * Global Functions
- X ******************************************************************/
- X
- X/*
- X * CreateNoticeBox -- create the notice box/button details and the window
- X */
- XnoticeBoxDetails *
- XCreateNoticeBox(dpy,screen,noticeBox,callback)
- X Display *dpy;
- X int screen;
- X NoticeBox *noticeBox;
- X void (*callback)();
- X{
- X XSetWindowAttributes attributes;
- X noticeBoxDetails *boxDetails;
- X int i,defaultButton;
- X
- X /*
- X * Create box details and button details
- X */
- X boxDetails = MemNew(noticeBoxDetails);
- X boxDetails->buttonInfo =
- X (noticeButtonDetails *)MemAlloc( noticeBox->numButtons
- X * (unsigned int)sizeof(noticeButtonDetails) );
- X boxDetails->noticeBox = MemNew(NoticeBox);
- X
- X /*
- X * Init basic box details
- X * - copy the passed in noticeBox since this is interposition
- X */
- X boxDetails->dpy = dpy;
- X boxDetails->scrInfo = GetScrInfoOfScreen(screen);
- X boxDetails->noticeCallback = callback;
- X *boxDetails->noticeBox = *noticeBox;
- X
- X boxDetails->noticeBox->buttonText =
- X MemAlloc(noticeBox->numButtons * sizeof(char *));
- X
- X for (i = 0; i < noticeBox->numButtons; i++)
- X boxDetails->noticeBox->buttonText[i] =
- X MemNewString(noticeBox->buttonText[i]);
- X
- X boxDetails->noticeBox->msgText = MemNewString(noticeBox->msgText);
- X
- X /*
- X * Figure out size to make window and where to put it
- X */
- X calculateBoxDimensions(boxDetails->noticeBox,boxDetails);
- X
- X /*
- X * Set up window attributes structure
- X */
- X attributes.border_pixel = 0;
- X attributes.colormap = boxDetails->scrInfo->colormap;
- X attributes.event_mask = NOTICE_EVENT_MASK;
- X attributes.save_under = True;
- X
- X /*
- X * Create window
- X */
- X boxDetails->window = XCreateWindow(dpy,
- X RootWindow(dpy,screen),
- X boxDetails->x, boxDetails->y,
- X boxDetails->boxWidth,
- X boxDetails->boxHeight, 0,
- X boxDetails->scrInfo->depth,
- X InputOutput,
- X boxDetails->scrInfo->visual,
- X NOTICE_ATTR_MASK,
- X &attributes );
- X
- X boxDetails->buttonSelected = -1;
- X boxDetails->buttonFocus = noticeBox->defaultButton;
- X boxDetails->buttonDown = -1;
- X boxDetails->buttonDrawnDown = False;
- X boxDetails->ignoreExpose = True;
- X boxDetails->warped = False;
- X
- X return boxDetails;
- X}
- X
- X/*
- X * DestroyNoticeBox -- destroys the notice box/button details and window
- X */
- Xvoid
- XDestroyNoticeBox(boxDetails)
- X noticeBoxDetails *boxDetails;
- X{
- X int i;
- X
- X XDestroyWindow(boxDetails->dpy,boxDetails->window);
- X
- X for (i=0; i<boxDetails->numStrings; i++)
- X MemFree(boxDetails->stringText[i]);
- X MemFree(boxDetails->stringText);
- X MemFree(boxDetails->buttonInfo);
- X for (i=0; i<boxDetails->noticeBox->numButtons; i++)
- X MemFree(boxDetails->noticeBox->buttonText[i]);
- X MemFree(boxDetails->noticeBox->buttonText);
- X MemFree(boxDetails->noticeBox->msgText);
- X MemFree(boxDetails->noticeBox);
- X MemFree(boxDetails);
- X}
- X
- X/*
- X * ShowNoticeBox -- Brings up the notice box
- X */
- Xvoid
- XShowNoticeBox(dpy,details)
- X Display *dpy;
- X noticeBoxDetails *details;
- X{
- X int defaultButton;
- X int grabstat;
- X
- X /*
- X * Map the window, then grab the pointer, the keyboard, and the
- X * server. Return immediately if we couldn't grab the pointer, but
- X * only issue a warning if we couldn't grab the keyboard. We need to
- X * map the window first, otherwise the grabs will fail.
- X */
- X XMapRaised(dpy,details->window);
- X grabstat = XGrabPointer(dpy, details->window, False,
- X ButtonPressMask | ButtonReleaseMask,
- X GrabModeAsync, GrabModeAsync,
- X None, None, CurrentTime);
- X
- X if (grabstat != GrabSuccess) {
- X noticeDone(dpy, details);
- X ErrorWarning(gettext("failed to grab pointer"));
- X return;
- X }
- X
- X grabstat = XGrabKeyboard(dpy, details->window, False,
- X GrabModeAsync, GrabModeAsync, CurrentTime);
- X if (grabstat != GrabSuccess)
- X ErrorWarning(gettext("failed to grab keyboard"));
- X
- X if (GRV.ServerGrabs)
- X XGrabServer(dpy);
- X
- X /*
- X * Draw notice window immediately. The first expose event is ignored,
- X * so there is no redundant repaint.
- X */
- X drawNoticeBox(details->noticeBox,details);
- X
- X if (GRV.Beep != BeepNever)
- X XBell(dpy,100);
- X
- X if (GRV.PopupJumpCursor) {
- X int dummyInt;
- X unsigned int dummyUInt;
- X Window dummyWin;
- X
- X /* save current mouse position */
- X XQueryPointer(dpy,details->scrInfo->rootid,
- X &dummyWin,&dummyWin,
- X &(details->pointerX),&(details->pointerY),
- X &dummyInt,&dummyInt,&dummyUInt);
- X
- X /* warp pointer to default button */
- X defaultButton = details->noticeBox->defaultButton;
- X
- X XWarpPointer(dpy,None,details->window,0,0,0,0,
- X details->buttonInfo[defaultButton].x
- X + details->buttonInfo[defaultButton].fullWidth/2,
- X details->buttonInfo[defaultButton].y
- X + details->buttonHeight/2 );
- X
- X details->warped = True;
- X }
- X
- X InstallInterposer(noticeInterposer,details);
- X}
- X
- X
- X
- X/*
- X * UseNoticeBox -- pop up a box which forces the user to answer
- X * a question using the buttons
- X *
- X * Arguments:
- X * dpy - pointer to current display
- X * screen - index to current screen
- X * noticeBox - pointer to NoticeBox structure:
- X * numButtons (number of buttons)
- X * defaultButton (index into buttonText for mouse warp)
- X * buttonText (array of strings for button text)
- X * msgText (msg string for description w/ newlines)
- X * boxX (box origin (-1 =use default/centered))
- X * boxY (box origin (-1 =use default/centered))
- X *
- X * Default placement of the box is centered in the display
- X * Returns -1 on failure (0 for 0th button, 1 for 1st button, etc.)
- X */
- Xvoid
- XUseNoticeBoxSync(dpy,screen,noticeBox,callback)
- X Display *dpy;
- X int screen;
- X NoticeBox *noticeBox;
- X void (*callback)();
- X{
- X noticeBoxDetails *boxDetails;
- X
- X boxDetails = CreateNoticeBox(dpy,screen,noticeBox,callback);
- X
- X ShowNoticeBox(dpy,boxDetails);
- X}
- X
- X/*
- X * UseNoticeBox() -- NoticeBox with no callback
- X */
- Xint
- XUseNoticeBox( dpy, screen, noticeBox )
- XDisplay *dpy;
- Xint screen;
- XNoticeBox *noticeBox;
- X{
- X UseNoticeBoxSync(dpy,screen,noticeBox,NULL);
- X}
- X
- END_OF_FILE
- if test 22967 -ne `wc -c <'Notice.c'`; then
- echo shar: \"'Notice.c'\" unpacked with wrong size!
- fi
- # end of 'Notice.c'
- fi
- if test -f 'ol_button.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ol_button.c'\"
- else
- echo shar: Extracting \"'ol_button.c'\" \(26874 characters\)
- sed "s/^X//" >'ol_button.c' <<'END_OF_FILE'
- X#ident "@(#)ol_button.c 1.1 olvwm version 1/3/92"
- X
- X/*
- X * Based on
- X#ident "@(#)ol_button.c 1.40 91/09/06 SMI"
- X *
- X */
- X
- X/*
- X * Copyright 1989-1990 Sun Microsystems See LEGAL_NOTICE for terms of
- X * disclosure.
- X */
- X
- X/*
- X * OPEN LOOK object drawing package Sun Microsystems, Inc.
- X *
- X * OLGX_button.c Menu button module
- X */
- X
- X#include <stdio.h>
- X#include <X11/Xlib.h>
- X#include <X11/Xutil.h>
- X#include "olgx_impl.h"
- X
- X#include "win.h"
- X#include "menu.h"
- X
- X/*
- X * Private function declarations
- X */
- X
- Xvoid olgx_set_busy_stipple();
- Xvoid olgx_draw_pixmap_label();
- X
- Xvoid
- Xolgx_draw_button(info, win, x, y, width, height, label, state)
- X Graphics_info *info;
- X Window win;
- X int x, y, width, height;
- X void *label;
- X int state;
- X{
- X XTextItem item;
- X char string[STRING_SIZE];
- X short add_ins[STRING_SIZE];
- X register int i;
- X int num_add;
- X int inside_width; /* width minus endcaps */
- X int top_color, bottom_color, fill_color;
- X
- X
- X inside_width = width - (2 * info->endcap_width);
- X num_add = calc_add_ins(inside_width - 1, add_ins);
- X item.nchars = 2 + num_add;
- X item.font = None;
- X item.chars = string;
- X item.delta = 0;
- X
- X
- X if (height)
- X /* variable height button-- possibly a pixmap label */
- X
- X olgx_draw_varheight_button(info, win, x, y, width, height, state);
- X
- X else {
- X
- X if (info->three_d) {
- X
- X /*
- X * 3d determine what colors we should draw in
- X */
- X
- X if (state & OLGX_INVOKED) { /* invoked button */
- X top_color = OLGX_BG3;
- X bottom_color = OLGX_WHITE;
- X fill_color = OLGX_BG2;
- X
- X } else if ((state & OLGX_DEFAULT) && (state & OLGX_MENU_ITEM)) {
- X
- X /* default menu item */
- X top_color = bottom_color = OLGX_BG3;
- X fill_color = OLGX_BG1;
- X
- X } else if (state & OLGX_MENU_ITEM && state & OLGX_BUSY) {
- X /* busy menu item */
- X
- X fill_color = top_color = bottom_color = OLGX_BG1;
- X
- X } else if (state & OLGX_MENU_ITEM) { /* normal menu item */
- X
- X fill_color = top_color = bottom_color = NONE;
- X
- X } else { /* normal panel button */
- X
- X top_color = OLGX_WHITE;
- X bottom_color = OLGX_BG3;
- X fill_color = OLGX_BG1;
- X
- X }
- X
- X if (state & OLGX_BUSY) {
- X
- X /*
- X * This routine changes GC information on-the-fly, but it is
- X * assumed that OLGX_BUSY won't be called often, so it makes
- X * sense to use the same GC rather than one for ` each color.
- X */
- X
- X if (!info->gc_rec[OLGX_BUSYGC])
- X olgx_initialise_gcrec(info, OLGX_BUSYGC);
- X fill_color = OLGX_BUSYGC;
- X
- X }
- X /* only check erase on transparent items */
- X
- X if (fill_color == NONE) {
- X
- X if (state & OLGX_ERASE) {
- X
- X /*
- X * to improve performance, we erase a rectangle the size
- X * of a button rather than drawing a real button.
- X */
- X
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_BG1]->gc,
- X x, y, width, Button_Height(info));
- X }
- X } else { /* if not transparent, actually draw the
- X * button */
- X
- X if (top_color != NONE) {
- X
- X /* draw the top part of the button */
- X
- X string[0] = BUTTON_UL;
- X VARIABLE_LENGTH_MACRO(1, BUTTON_TOP_1);
- X string[i + 1] = BUTTON_UR;
- X XDrawText(info->dpy, win,
- X info->gc_rec[top_color]->gc, x, y, &item, 1);
- X
- X }
- X if (bottom_color != NONE) {
- X
- X /* draw the bottom part of the button */
- X
- X string[0] = BUTTON_LL;
- X VARIABLE_LENGTH_MACRO(1, BUTTON_BOTTOM_1);
- X string[i + 1] = BUTTON_LR;
- X XDrawText(info->dpy, win,
- X info->gc_rec[bottom_color]->gc, x, y, &item, 1);
- X
- X }
- X /* Fill in the button */
- X
- X string[0] = BUTTON_LEFT_ENDCAP_FILL;
- X VARIABLE_LENGTH_MACRO(1, BUTTON_FILL_1);
- X string[i + 1] = BUTTON_RIGHT_ENDCAP_FILL;
- X XDrawText(info->dpy, win,
- X info->gc_rec[fill_color]->gc, x, y, &item, 1);
- X
- X /* draw the inner border of a default button (not menu item) */
- X
- X if (!(state & OLGX_MENU_ITEM) && (state & OLGX_DEFAULT)) {
- X string[0] = DFLT_BUTTON_LEFT_ENDCAP;
- X VARIABLE_LENGTH_MACRO(1, DFLT_BUTTON_MIDDLE_1);
- X string[i + 1] = DFLT_BUTTON_RIGHT_ENDCAP;
- X XDrawText(info->dpy, win,
- X info->gc_rec[OLGX_BG3]->gc, x, y, &item, 1);
- X }
- X } /* Not transparent */
- X
- X }
- X /* End 3D */
- X else { /* draw 2d button */
- X
- X if (state & OLGX_ERASE)
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x, y,
- X width + 1, Button_Height(info));
- X
- X
- X if ((state & OLGX_INVOKED)) {
- X string[0] = BUTTON_FILL_2D_LEFTENDCAP;
- X VARIABLE_LENGTH_MACRO(1, BUTTON_FILL_2D_MIDDLE_1);
- X string[i + 1] = BUTTON_FILL_2D_RIGHTENDCAP;
- X XDrawText(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, x, y, &item, 1);
- X
- X } else if (state & OLGX_BUSY) {
- X
- X if (!info->gc_rec[OLGX_BUSYGC])
- X olgx_initialise_gcrec(info, OLGX_BUSYGC);
- X string[0] = BUTTON_FILL_2D_LEFTENDCAP;
- X VARIABLE_LENGTH_MACRO(1, BUTTON_FILL_2D_MIDDLE_1);
- X string[i + 1] = BUTTON_FILL_2D_RIGHTENDCAP;
- X XDrawText(info->dpy, win,
- X info->gc_rec[OLGX_BUSYGC]->gc, x, y, &item, 1);
- X
- X } else if (!(state & OLGX_MENU_ITEM) && (state & OLGX_DEFAULT)) {
- X
- X /* draw the 2d default ring if not menu-item */
- X
- X string[0] = DFLT_BUTTON_LEFT_ENDCAP;
- X VARIABLE_LENGTH_MACRO(1, DFLT_BUTTON_MIDDLE_1);
- X string[i + 1] = DFLT_BUTTON_RIGHT_ENDCAP;
- X XDrawText(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, x, y, &item, 1);
- X
- X } else if (state & OLGX_DEFAULT) {
- X
- X /* draw the 2d default ring for menu item */
- X
- X string[0] = MENU_DFLT_OUTLINE_LEFT_ENDCAP;
- X VARIABLE_LENGTH_MACRO(1, MENU_DFLT_OUTLINE_MIDDLE_1);
- X string[i + 1] = MENU_DFLT_OUTLINE_RIGHT_ENDCAP;
- X XDrawText(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, x, y, &item, 1);
- X
- X }
- X /* draw the button if it is not a menu item */
- X
- X if (!(state & OLGX_MENU_ITEM)) {
- X string[0] = BUTTON_OUTLINE_LEFT_ENDCAP;
- X VARIABLE_LENGTH_MACRO(1, BUTTON_OUTLINE_MIDDLE_1);
- X string[i + 1] = BUTTON_OUTLINE_RIGHT_ENDCAP;
- X XDrawText(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, x, y, &item, 1);
- X }
- X }
- X }
- X
- X /*
- X * Place the label, if specified.
- X */
- X
- X if (label) {
- X
- X if (state & OLGX_LABEL_IS_PIXMAP) {
- X
- X int centerx, centery;
- X
- X centerx = (width - ((Pixlabel *) label)->width >> 1);
- X centery = (height - ((Pixlabel *) label)->height >> 1);
- X olgx_draw_pixmap_label(info, win,
- X ((Pixlabel *) label)->pixmap,
- X x + ((centerx > 0) ? centerx : 0),
- X y + ((centery > 0) ? centery : 0),
- X ((Pixlabel *) label)->width,
- X (height) ? height : Button_Height(info) - 2, state);
- X } else if (state & OLGX_LABEL_IS_COMB) {
- X Comblabel *combLabel;
- X int centery;
- X
- X combLabel = (Comblabel *) label;
- X centery = (((height) ? height : Button_Height(info) - 2) -
- X combLabel->pixlabel.height) >> 1;
- X olgx_draw_pixmap_label(info, win, combLabel->pixlabel.pixmap,
- X x + info->endcap_width,
- X y + ((centery > 0) ? centery : 0),
- X combLabel->pixlabel.width,
- X (height) ? combLabel->pixlabel.height :
- X Button_Height(info) - 2, state);
- X#ifdef OW_I18N
- X olgx_draw_text(info, win, (wchar_t *) combLabel->strlabel,
- X#else
- X olgx_draw_text(info, win, (char *) combLabel->strlabel,
- X#endif
- X x + info->endcap_width + combLabel->pixlabel.width + 5,
- X y + info->button_height - info->base_off,
- X inside_width - combLabel->pixlabel.width -
- X ((state & OLGX_MENU_MARK) ? info->mm_width : 0),
- X state);
- X } else {
- X
- X#ifdef OW_I18N
- X /*
- X * FIX_ME: Binary compat. Need some flag to tell char or
- X * wchar_t.
- X */
- X olgx_draw_text(info, win, (wchar_t *) label,
- X#else
- X olgx_draw_text(info, win, (char *) label,
- X#endif /* OW_I18N */
- X x + info->endcap_width,
- X y + info->button_height - info->base_off,
- X inside_width -
- X ((state & OLGX_MENU_MARK) ?
- X info->mm_width : 0),
- X state);
- X }
- X }
- X /*
- X * Place the menu mark, if desired.
- X */
- X
- X if (state & OLGX_MENU_MARK) {
- X
- X /*
- X * draw the menu mark. (fill_color != OLGX_BG2) causes the menu mark
- X * to be filled in only when necessary
- X */
- X
- X if (info->three_d)
- X olgx_draw_menu_mark(info, win,
- X x + (width - info->endcap_width - info->mm_width),
- X y + (info->button_height - info->mm_height -
- X info->base_off),
- X state, (fill_color != OLGX_BG2));
- X else
- X olgx_draw_menu_mark(info, win,
- X x + (width - info->endcap_width - info->mm_width),
- X y + (info->button_height - info->mm_height -
- X info->base_off),
- X state, 0);
- X }
- X /*
- X * Mark the item as inactive, if specified
- X */
- X
- X if (state & OLGX_INACTIVE) {
- X olgx_stipple_rect(info, win, x, y, width,
- X (height) ? height + 8 : Button_Height(info));
- X
- X }
- X}
- X
- X
- X/*
- X * Draw the outline of a variable height button Private Routine
- X */
- X
- Xvoid
- Xolgx_draw_varheight_button(info, win, x, y, width, height, state)
- X Graphics_info *info;
- X Window win;
- X int x, y, width, height;
- X int state;
- X
- X{
- X
- X
- X char string[2];
- X XSegment seg[4];
- X
- X
- X if (info->three_d) {
- X
- X /* 3D */
- X /* Draw all the four corners */
- X
- X if (state & OLGX_INVOKED)
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_BG2]->gc, x + 1,
- X y + 1, width - 2, height - 2);
- X else
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_BG1]->gc, x + 1,
- X y + 1, width - 2, height - 2);
- X
- X string[0] = PIXLABEL_BUTTON_UL;
- X XDrawString(info->dpy, win, (state & OLGX_INVOKED) ?
- X info->gc_rec[OLGX_BG3]->gc : info->gc_rec[OLGX_WHITE]->gc, x, y,
- X string, 1);
- X
- X string[0] = PIXLABEL_BUTTON_UR;
- X XDrawString(info->dpy, win, (state & OLGX_INVOKED) ?
- X info->gc_rec[OLGX_BG3]->gc : info->gc_rec[OLGX_WHITE]->gc,
- X x + width - VARHEIGHT_BUTTON_CORNER_DIMEN, y, string, 1);
- X
- X string[0] = PIXLABEL_BUTTON_LL;
- X XDrawString(info->dpy, win, (state & OLGX_INVOKED) ?
- X info->gc_rec[OLGX_WHITE]->gc : info->gc_rec[OLGX_BG3]->gc, x, y +
- X height - VARHEIGHT_BUTTON_CORNER_DIMEN, string, 1);
- X
- X string[0] = PIXLABEL_BUTTON_LR;
- X XDrawString(info->dpy, win, (state & OLGX_INVOKED) ?
- X info->gc_rec[OLGX_WHITE]->gc : info->gc_rec[OLGX_BG3]->gc,
- X x + width - VARHEIGHT_BUTTON_CORNER_DIMEN,
- X y + height - VARHEIGHT_BUTTON_CORNER_DIMEN, string, 1);
- X
- X seg[0].x1 = x + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[0].y1 = seg[0].y2 = y;
- X seg[0].x2 = x + width - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].x1 = seg[1].x2 = x;
- X seg[1].y1 = y + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].y2 = y + height - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X XDrawSegments(info->dpy, win, (state & OLGX_INVOKED) ?
- X info->gc_rec[OLGX_BG3]->gc :
- X info->gc_rec[OLGX_WHITE]->gc,
- X seg, 2);
- X seg[0].x1 = x + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[0].y1 = seg[0].y2 = y + height - 1;
- X seg[0].x2 = x + width - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].x1 = seg[1].x2 = x + width - 1;
- X seg[1].y1 = y + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].y2 = y + height - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X XDrawSegments(info->dpy, win, (state & OLGX_INVOKED) ?
- X info->gc_rec[OLGX_WHITE]->gc :
- X info->gc_rec[OLGX_BG3]->gc,
- X seg, 2);
- X
- X
- X } else {
- X
- X /* 2D */
- X
- X if (state & OLGX_INVOKED)
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x + 3,
- X y + 3, width - 6, height - 6);
- X else
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x + 1,
- X y + 1, width - 2, height - 2);
- X
- X string[0] = PIXLABEL_BUTTON_UL;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y, string, 1);
- X string[0] = PIXLABEL_BUTTON_UR;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc,
- X x + width - VARHEIGHT_BUTTON_CORNER_DIMEN, y, string, 1);
- X
- X string[0] = PIXLABEL_BUTTON_LL;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x,
- X y + height - VARHEIGHT_BUTTON_CORNER_DIMEN, string, 1);
- X
- X string[0] = PIXLABEL_BUTTON_LR;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc,
- X x + width - VARHEIGHT_BUTTON_CORNER_DIMEN,
- X y + height - VARHEIGHT_BUTTON_CORNER_DIMEN, string, 1);
- X
- X seg[0].x1 = x + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[0].y1 = seg[0].y2 = y;
- X seg[0].x2 = x + width - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].x1 = seg[1].x2 = x;
- X seg[1].y1 = y + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].y2 = y + height - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[2].x1 = x + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[2].y1 = seg[2].y2 = y + height - 1;
- X seg[2].x2 = x + width - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[3].x1 = seg[3].x2 = x + width - 1;
- X seg[3].y1 = y + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[3].y2 = y + height - VARHEIGHT_BUTTON_CORNER_DIMEN;
- X XDrawSegments(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, seg, 4);
- X
- X }
- X
- X /*
- X * REMIND: the code below probably uses OLGX_BLACK incorrectly. It should
- X * be changed to use OLGX_BG3 in 3D mode as appropriate.
- X */
- X
- X if (state & OLGX_DEFAULT) {
- X
- X string[0] = PIXLABEL_DEF_BUTTON_UL;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y,
- X string, 1);
- X
- X string[0] = PIXLABEL_DEF_BUTTON_UR;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x + width -
- X VARHEIGHT_BUTTON_CORNER_DIMEN, y, string, 1);
- X
- X string[0] = PIXLABEL_DEF_BUTTON_LL;
- X XDrawString(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, x, y + height -
- X VARHEIGHT_BUTTON_CORNER_DIMEN, string, 1);
- X
- X string[0] = PIXLABEL_DEF_BUTTON_LR;
- X XDrawString(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, x + width -
- X VARHEIGHT_BUTTON_CORNER_DIMEN, y + height -
- X VARHEIGHT_BUTTON_CORNER_DIMEN, string, 1);
- X
- X seg[0].x1 = x + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[0].y1 = seg[0].y2 = y + 2;
- X seg[0].x2 = x + width - VARHEIGHT_BUTTON_CORNER_DIMEN - 1;
- X seg[1].x1 = seg[1].x2 = x + 2;
- X seg[1].y1 = y + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[1].y2 = y + height - VARHEIGHT_BUTTON_CORNER_DIMEN - 1;
- X seg[2].x1 = x + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[2].y1 = seg[2].y2 = y + height - 1 - 2;
- X seg[2].x2 = x + width - VARHEIGHT_BUTTON_CORNER_DIMEN - 1;
- X seg[3].x1 = seg[3].x2 = x + width - 1 - 2;
- X seg[3].y1 = y + VARHEIGHT_BUTTON_CORNER_DIMEN;
- X seg[3].y2 = y + height - VARHEIGHT_BUTTON_CORNER_DIMEN - 1;
- X XDrawSegments(info->dpy, win,
- X info->gc_rec[OLGX_BLACK]->gc, seg, 4);
- X
- X }
- X if (state & OLGX_BUSY) {
- X
- X if (!info->gc_rec[OLGX_BUSYGC])
- X olgx_initialise_gcrec(info, OLGX_BUSYGC);
- X
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_BUSYGC]->gc, x + 2,
- X y + 2, width - 4, height - 4);
- X }
- X}
- X
- X
- Xvoid
- Xolgx_draw_menu_mark(info, win, x, y, state, fill_in)
- X Graphics_info *info;
- X Window win;
- X int state, fill_in;
- X{
- X char string[3];
- X
- X if (state & OLGX_VERT_MENU_MARK)
- X string[0] = VERT_MENU_MARK_UL;
- X else if (state & OLGX_HORIZ_MENU_MARK)
- X string[0] = HORIZ_MENU_MARK_UL;
- X else if (state & OLGX_HORIZ_BACK_MENU_MARK)
- X string[0] = HORIZ_BACK_MENU_MARK_UL;
- X else if (state & OLGX_VERT_BACK_MENU_MARK)
- X string[0] = VERT_BACK_MENU_MARK_UL;
- X
- X string[1] = string[0] + 1;
- X
- X if ((state & OLGX_INVOKED) && (!info->three_d))
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x, y, &string[0],
- X info->three_d ? 1 : 2);
- X else
- X XDrawString(info->dpy, win, info->three_d ? info->gc_rec[OLGX_BG3]->gc :
- X info->gc_rec[OLGX_BLACK]->gc,
- X x, y, &string[0], info->three_d ? 1 : 2);
- X
- X if (info->three_d)
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x, y, &string[1], 1);
- X
- X /* fill in the menu mark, if requested */
- X
- X if (fill_in) {
- X string[0] = string[0] + 2;
- X XDrawString(info->dpy, win, (info->three_d)?info->gc_rec[OLGX_BG2]->gc :
- X info->gc_rec[OLGX_BLACK]->gc,
- X x, y, &string[0], 1);
- X
- X }
- X}
- X
- X
- X
- X
- Xvoid
- Xolgx_draw_abbrev_button(info, win, x, y, state)
- X Graphics_info *info;
- X Window win;
- X int x, y;
- X int state;
- X{
- X XTextItem item;
- X char string[3];
- X int top_color, bottom_color, fill_color;
- X
- X item.nchars = 1;
- X item.font = None;
- X item.chars = string;
- X item.delta = 0;
- X
- X
- X if (!info->three_d) { /* 2d */
- X
- X if (state & OLGX_ERASE)
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x, y,
- X Abbrev_MenuButton_Width(info), Abbrev_MenuButton_Width(info));
- X
- X if (state & OLGX_BUSY) {
- X
- X if (!info->gc_rec[OLGX_BUSYGC])
- X olgx_initialise_gcrec(info, OLGX_BUSYGC);
- X string[0] = ABBREV_MENU_FILL;
- X XDrawText(info->dpy, win, info->gc_rec[OLGX_BUSYGC]->gc, x, y, &item, 1);
- X }
- X if (state & OLGX_INVOKED) {
- X
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x + 2, y + 2,
- X (Abbrev_MenuButton_Width(info) - 4),
- X (Abbrev_MenuButton_Width(info) - 4));
- X string[0] = OLG_ABBREV_MENU_BUTTON_INVERTED;
- X XDrawText(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y, &item, 1);
- X
- X } else {
- X
- X string[0] = OLG_ABBREV_MENU_BUTTON;
- X XDrawText(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y, &item, 1);
- X
- X }
- X
- X } else { /* 3d */
- X
- X if (state & OLGX_INVOKED) {
- X
- X top_color = OLGX_BG3;
- X bottom_color = OLGX_WHITE;
- X fill_color = OLGX_BG2;
- X
- X } else {
- X
- X top_color = OLGX_WHITE;
- X bottom_color = OLGX_BG3;
- X fill_color = OLGX_BG1;
- X
- X }
- X
- X if (state & OLGX_BUSY) {
- X
- X if (!info->gc_rec[OLGX_BUSYGC])
- X olgx_initialise_gcrec(info, OLGX_BUSYGC);
- X fill_color = OLGX_BUSYGC;
- X
- X }
- X string[0] = ABBREV_MENU_UL;
- X XDrawText(info->dpy, win, info->gc_rec[top_color]->gc, x, y, &item, 1);
- X
- X string[0] = ABBREV_MENU_LR;
- X XDrawText(info->dpy, win, info->gc_rec[bottom_color]->gc, x, y, &item, 1);
- X
- X string[0] = ABBREV_MENU_FILL;
- X XDrawText(info->dpy, win, info->gc_rec[fill_color]->gc, x, y, &item, 1);
- X olgx_draw_menu_mark(info, win, x + ((Abbrev_MenuButton_Width(info)
- X - info->mm_width) >> 1),
- X y + ((1 + Abbrev_MenuButton_Height(info) -
- X info->mm_height) >> 1),
- X OLGX_VERT_MENU_MARK, 1);
- X
- X }
- X
- X /* If it is inactive fill the rectangle with inactive pixmap */
- X
- X if (state & OLGX_INACTIVE) {
- X
- X olgx_stipple_rect(info, win, x, y, Abbrev_MenuButton_Width(info),
- X Abbrev_MenuButton_Height(info));
- X }
- X}
- X
- X
- Xvoid
- Xolgx_stipple_rect(info, win, x, y, width, height)
- X Graphics_info *info;
- X Window win;
- X int x, y, width, height;
- X{
- X
- X
- X if (!info->gc_rec[OLGX_GREY_OUT])
- X olgx_initialise_gcrec(info, OLGX_GREY_OUT);
- X
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_GREY_OUT]->gc,
- X x, y, width, height);
- X}
- X
- Xvoid
- Xolgx_draw_text(info, win, string, x, y, max_width, state)
- X Graphics_info *info;
- X Window win;
- X#ifdef OW_I18N
- X wchar_t *string;
- X#else
- X char *string;
- X#endif /* OW_I18N */
- X int x, y, max_width;
- X int state;
- X{
- X
- X#ifdef OW_I18N
- X int len = wslen(string);
- X#else
- X int len = strlen(string);
- X#endif /* OW_I18N */
- X register int i;
- X short more_flag = 0;
- X
- X
- X /*
- X * if the string is too long, we'll have to truncate it max_width == 0
- X * implies don't truncate.
- X */
- X
- X#ifdef OW_I18N
- X if (max_width && XwcTextEscapement(info->textfontset,
- X string, len) > max_width) {
- X#else
- X if (max_width && XTextWidth(info->textfont, string, len) > max_width) {
- X#endif /* OW_I18N */
- X int current_width = 0;
- X for (i = 0; (i < len && current_width <= max_width); i++) {
- X#ifdef OW_I18N
- X current_width +=
- X XwcTextEscapement(info->textfontset, &string[i], 1);
- X#else
- X current_width += XTextWidth(info->textfont, &string[i], 1);
- X#endif /* OW_I18N */
- X }
- X
- X /*
- X * at this point, i-1 represents the number of chars of string that
- X * will fit into max_width.
- X */
- X
- X len = i - 2;
- X if (state & OLGX_MORE_ARROW)
- X more_flag = 1;
- X }
- X if (!info->gc_rec[OLGX_TEXTGC])
- X olgx_initialise_gcrec(info, OLGX_TEXTGC);
- X if (!info->three_d)
- X if (!info->gc_rec[OLGX_TEXTGC_REV])
- X olgx_initialise_gcrec(info, OLGX_TEXTGC_REV);
- X
- X if ((state & OLGX_INVOKED) && !(info->three_d))
- X#ifdef OW_I18N
- X XwcDrawString(info->dpy, win, info->textfontset,
- X info->gc_rec[OLGX_TEXTGC_REV]->gc, x, y, string, len);
- X else
- X XwcDrawString(info->dpy, win, info->textfontset,
- X info->gc_rec[OLGX_TEXTGC]->gc, x, y, string, len);
- X#else OW_I18N
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_TEXTGC_REV]->gc, x, y,
- X string, len);
- X else
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_TEXTGC]->gc, x, y, string, len);
- X#endif /* OW_I18N */
- X
- X if (more_flag) /* render a more arrow at the end of the string */
- X#ifdef OW_I18N
- X olgx_draw_menu_mark(info,win,
- X x+XwcTextEscapement(info->textfontset,string,len)+1,
- X#else
- X olgx_draw_menu_mark(info,win,x+XTextWidth(info->textfont,string,len)+1 ,
- X#endif /* OW_I18N */
- X y-MenuMark_Height(info),OLGX_HORIZ_MENU_MARK,1);
- X}
- X
- Xvoid
- Xolgx_draw_pixmap_label(info, win, pix, x, y, width, height, state)
- X Graphics_info *info;
- X Window win;
- X Pixmap pix;
- X int x, y, width, height, state;
- X{
- X
- X
- X unsigned long savebg1;
- X unsigned long savebg2;
- X Window root;
- X int x_dummy,y_dummy;
- X unsigned int w_dummy,h_dummy,bw_dummy;
- X unsigned int depth;
- X GC gc;
- X
- X
- X if (!info->gc_rec[OLGX_TEXTGC])
- X olgx_initialise_gcrec(info, OLGX_TEXTGC);
- X if (!info->three_d)
- X if (!info->gc_rec[OLGX_TEXTGC_REV])
- X olgx_initialise_gcrec(info, OLGX_TEXTGC_REV);
- X
- X if ((state & OLGX_INVOKED)) {
- X if (info->three_d) {
- X /*
- X * reset the value of the textgc background from bg1 to bg2 in
- X * invoked mode to get the transparent pixmap effect
- X */
- X savebg1 = olgx_get_single_color(info, OLGX_BG1);
- X savebg2 = olgx_get_single_color(info, OLGX_BG2);
- X olgx_set_single_color(info, OLGX_BG1, savebg2, OLGX_SPECIAL);
- X gc = info->gc_rec[OLGX_TEXTGC]->gc;
- X }
- X else {
- X if (!info->gc_rec[OLGX_TEXTGC_REV])
- X olgx_initialise_gcrec(info, OLGX_TEXTGC_REV);
- X gc = info->gc_rec[OLGX_TEXTGC_REV]->gc;
- X }
- X }
- X else gc = info->gc_rec[OLGX_TEXTGC]->gc;
- X
- X /*
- X * Performance Problem - RoundTrip request
- X * Depth should be passed as part of Pixlabel struct
- X */
- X
- X XGetGeometry(info->dpy,pix,&root,&x_dummy,&y_dummy,&w_dummy,
- X &h_dummy,&bw_dummy,&depth);
- X if (depth > 1)
- X XCopyArea(info->dpy,
- X pix, /* src */
- X win, /* dest */
- X gc,
- X 0, 0, /* src x,y */
- X width, height,
- X x, y);
- X else
- X XCopyPlane(info->dpy,
- X pix, /* src */
- X win, /* dest */
- X gc,
- X 0, 0, /* src x,y */
- X width, height,
- X x, y,
- X (unsigned long) 1);
- X
- X
- X /* Restore the original colors to the textgc */
- X
- X if ((state & OLGX_INVOKED) && (info->three_d))
- X olgx_set_single_color(info, OLGX_BG1, savebg1, OLGX_SPECIAL);
- X
- X}
- X
- X
- X
- Xvoid
- Xolgx_draw_textscroll_button(info, win, x, y, state)
- X Graphics_info *info;
- X Window win;
- X int x, y;
- X int state;
- X
- X{
- X char string[2];
- X int width, height;
- X int arr_x, arr_y;
- X
- X /*
- X * A small hack to calculate the width, arrow postiton..etc since this
- X * routine is expected to tbe used infrequently it is not included as
- X * part of the info struct and the follwoing calculations take place each
- X * time-- a penalty affordable at the cost of infrequency
- X *
- X */
- X
- X if ((Abbrev_MenuButton_Height(info)) < 20) {
- X
- X width = height = Abbrev_MenuButton_Height(info);
- X
- X arr_y = 3;
- X arr_x = (width / 3) - 1;
- X
- X } else {
- X
- X width = height = 25; /* Special case size-19 */
- X arr_y = 5;
- X arr_x = 7;
- X
- X }
- X
- X
- X if (!(info->three_d)) { /* Start 2-D */
- X
- X if (state & OLGX_ERASE)
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x, y, width,
- X height);
- X
- X if (state & OLGX_SCROLL_FORWARD) {
- X
- X if (state & OLGX_INVOKED)
- X string[0] = TEXTSCROLLBUTTON_RIGHT_INV;
- X else
- X string[0] = TEXTSCROLLBUTTON_RIGHT;
- X
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y, string,1);
- X
- X } else if (state & OLGX_SCROLL_BACKWARD) {
- X
- X if (state & OLGX_INVOKED)
- X string[0] = TEXTSCROLLBUTTON_LEFT_INV;
- X else
- X string[0] = TEXTSCROLLBUTTON_LEFT;
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y, string,1);
- X }
- X }
- X /* End 2-D */
- X else { /* Start 3-D */
- X
- X olgx_draw_box(info, win, x, y, width, height, state, 0);
- X
- X if (state & OLGX_SCROLL_FORWARD)
- X olgx_draw_menu_mark(info, win, x + arr_x, y + arr_y,
- X OLGX_HORIZ_MENU_MARK | OLGX_INVOKED, 1);
- X else
- X olgx_draw_menu_mark(info, win, x + arr_x - 1, y + arr_y,
- X OLGX_HORIZ_BACK_MENU_MARK | OLGX_INVOKED, 1);
- X
- X } /* End 3-D */
- X
- X if (state & OLGX_INACTIVE)
- X olgx_stipple_rect(info, win, x, y, TextScrollButton_Width(info),
- X TextScrollButton_Height(info));
- X
- X}
- X
- X
- X
- X
- X
- X
- Xvoid
- Xolgx_draw_numscroll_button(info, win, x, y, state)
- X Graphics_info *info;
- X Window win;
- X int x, y, state;
- X
- X{
- X
- X char string[2];
- X int width, height, arr_x, arr_y;
- X
- X width = height = TextScrollButton_Height(info);
- X
- X if (width < 20) {
- X
- X arr_y = 3;
- X arr_x = (width / 3) - 1;
- X
- X } else {
- X
- X arr_y = 5;
- X arr_x = 7;
- X
- X }
- X
- X
- X if (!info->three_d) { /* draw 2-D */
- X
- X if (state & OLGX_ERASE)
- X XFillRectangle(info->dpy, win, info->gc_rec[OLGX_WHITE]->gc, x, y,
- X NumScrollButton_Width(info), height);
- X
- X if (state & OLGX_SCROLL_FORWARD)
- X string[0] = NUMERIC_SCROLL_BUTTON_RIGHT_INV;
- X
- X else if (state & OLGX_SCROLL_BACKWARD)
- X string[0] = NUMERIC_SCROLL_BUTTON_LEFT_INV;
- X
- X else
- X string[0] = NUMERIC_SCROLL_BUTTON_NORMAL;
- X
- X XDrawString(info->dpy, win, info->gc_rec[OLGX_BLACK]->gc, x, y, string, 1);
- X
- X } else { /* draw 3-D */
- X
- X olgx_draw_box(info, win, x, y, width, height,
- X (state & OLGX_SCROLL_BACKWARD) ?
- X OLGX_INVOKED : OLGX_NORMAL, 0);
- X olgx_draw_box(info, win, x + width, y, width, height,
- X (state & OLGX_SCROLL_FORWARD) ?
- X OLGX_INVOKED : OLGX_NORMAL, 0);
- X olgx_draw_menu_mark(info, win, x + arr_x, y + arr_y,
- X OLGX_VERT_BACK_MENU_MARK | OLGX_INVOKED, 1);
- X olgx_draw_menu_mark(info, win, x + arr_x + width, y + arr_y,
- X OLGX_VERT_MENU_MARK | OLGX_INVOKED, 1);
- X
- X }
- X
- X if (state & OLGX_INACTIVE)
- X olgx_stipple_rect(info, win, x, y, NumScrollButton_Width(info),
- X NumScrollButton_Height(info));
- X
- X if (state & OLGX_SCROLL_NO_FORWARD)
- X olgx_stipple_rect(info, win, x + TextScrollButton_Width(info) - 1, y,
- X TextScrollButton_Width(info),
- X NumScrollButton_Height(info));
- X
- X if (state & OLGX_SCROLL_NO_BACKWARD)
- X olgx_stipple_rect(info, win, x, y,
- X TextScrollButton_Width(info) - 2,
- X NumScrollButton_Height(info));
- X}
- X
- X
- X
- X
- X
- END_OF_FILE
- if test 26874 -ne `wc -c <'ol_button.c'`; then
- echo shar: \"'ol_button.c'\" unpacked with wrong size!
- fi
- # end of 'ol_button.c'
- fi
- if test -f 'vdm.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vdm.icon'\"
- else
- echo shar: Extracting \"'vdm.icon'\" \(1919 characters\)
- sed "s/^X//" >'vdm.icon' <<'END_OF_FILE'
- X#define vdm_width 64
- X#define vdm_height 45
- Xstatic char vdm_bits[] = {
- X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,
- X 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,
- X 0x71,0x00,0x00,0x00,0x00,0x00,0xc0,0xe1,0x86,0x01,0x00,0x00,0x00,0x00,0x38,
- X 0x1c,0x38,0x0e,0x00,0x00,0x00,0x00,0x07,0x03,0xc0,0x30,0x00,0x00,0x00,0xe0,
- X 0x70,0x1c,0x00,0xc7,0x01,0x00,0x00,0x1c,0x8e,0x61,0x00,0x18,0x06,0x00,0x80,
- X 0xc3,0x01,0x8e,0x03,0x07,0x18,0x00,0x70,0x20,0x00,0x10,0xec,0x00,0x17,0x00,
- X 0x0e,0x20,0x1c,0x10,0x10,0xe0,0x18,0xc0,0x01,0xc0,0x63,0x0e,0x00,0x1c,0x17,
- X 0x30,0x00,0x30,0x80,0x03,0x80,0xe3,0x10,0xd0,0x00,0x08,0x00,0x04,0x70,0x1c,
- X 0x10,0x10,0x07,0x08,0x00,0x04,0x8e,0x03,0x10,0x10,0x18,0x70,0x80,0xc3,0x71,
- X 0x01,0x10,0x10,0xe0,0x80,0x71,0x38,0x0e,0x01,0x18,0x10,0x00,0x03,0x0e,0xc7,
- X 0x01,0x01,0x17,0x10,0x00,0x1c,0xe0,0x38,0x00,0xe1,0x10,0x10,0x06,0x60,0x1c,
- X 0x07,0x00,0x1d,0x10,0x10,0x06,0x80,0xe3,0x00,0x00,0x03,0x10,0x10,0x06,0x00,
- X 0x1d,0x00,0x00,0x01,0x10,0x10,0x04,0x06,0x13,0x00,0x00,0x01,0x18,0x10,0x0c,
- X 0x06,0x11,0x00,0x00,0x01,0x17,0x10,0x0c,0x06,0x39,0x00,0x00,0xe1,0x10,0x10,
- X 0x08,0x02,0xc7,0x00,0x00,0x1d,0x10,0x10,0x18,0x03,0x01,0x07,0x00,0x03,0x10,
- X 0x10,0x18,0x03,0x01,0x18,0x00,0x01,0x10,0x10,0x98,0x01,0x01,0xe0,0x00,0x01,
- X 0x1c,0x10,0xb0,0x01,0x01,0x00,0x03,0x81,0x03,0x10,0xb0,0x01,0x01,0x00,0x1c,
- X 0x61,0x00,0x10,0xe0,0x00,0x01,0x00,0x60,0x1d,0x00,0x30,0x60,0x00,0x01,0x00,
- X 0x80,0x03,0x00,0xc0,0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x01,
- X 0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x60,0x00,
- X 0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
- X 0x0c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x01,0x00,0x00,0x00,0x00,0x00,
- X 0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
- END_OF_FILE
- if test 1919 -ne `wc -c <'vdm.icon'`; then
- echo shar: \"'vdm.icon'\" unpacked with wrong size!
- fi
- # end of 'vdm.icon'
- fi
- echo shar: End of archive 14 \(of 21\).
- cp /dev/null ark14isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 21 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Molecular Simulations, Inc. mail: dcmartin@postgres.berkeley.edu
- 796 N. Pastoria Avenue uucp: uwvax!ucbvax!dcmartin
- Sunnyvale, California 94086 at&t: 408/522-9236
-